import React, {useEffect} from 'react'
import { useDispatch, useSelector } from "react-redux"

export default function SagaPage() {
  const dispatch = useDispatch()
  const articleReducer = useSelector(state => state.articleReducer)
  useEffect(() => {
    dispatch({
      type: "loadArticles",
    })
  }, [])
  return (
    <div>
      {articleReducer.articles.map((item, index)=> (
        <div key={index}>
          {item.title}
          {item.content}
        </div>
      ))}
    </div>
  )
}
